<form class="form-horizontal" id="form-add-article">

    <div class="form-group">
        <label class="control-label col-xs-2">地区<span style="color: #FF0000;">*</span></label>
        <div class="col-xs-9">
            {include file="public/areaSelector" province-name="pro" city-name="city" /}
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">主办会员<span style="color: #FF0000;">*</span></label>
        <div class="col-xs-9">
            {include file="public/userSerarch" user-num-name="uid" /}
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">承办联盟商<span style="color: #FF0000;">*</span></label>
        <div class="col-xs-9">
            {include file="public/unionSerarch" union-num-name="union_id" /}
        </div>
    </div>

    <!--<div class="form-group">-->
        <!--<label class="control-label col-xs-2">-->
            <!--活动类型-->
            <!--<span style="color: #FF0000;">*</span>-->
        <!--</label>-->
        <!--<div class="col-xs-9">-->
            <!--<select id="category-selector" name="type" class="form-control" tabindex="-1" required>-->
                <!--<option value="">-->
                    <!--无选择-->
                <!--</option>-->
                <!--{volist name="category_list" id="item" key="itk"}-->
                <!--<option value="{$itk}">{$item}</option>-->
                <!--{/volist}-->
            <!--</select>-->
        <!--</div>-->
    <!--</div>-->

    <div class="form-group">
        <label class="control-label col-xs-2">
            活动主题
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            <input type="text" class="form-control" name="title"
                   placeholder="请输入活动主题" required>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-2">
            活动期限
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            {include file="public/agentDateRangePicker" picker-name="time_range" /}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-2">
            报名截止
            <span style="color: #FF0000;">*</span>
        </label>

        <div class="col-xs-9">
            {include file="public/oneDateRangePicker" onepicker-name="time_rangeone" /}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-2">
            缩略图
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            {include file="public/singleImageUploader" uploader-name="thumb" /}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-2">
            背景图片
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            {include file="public/singleImageUploader2" uploader-name2="background" /}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-2">
            H链币费用
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            <input type="number" class="form-control" name="coin"
                   placeholder="请输入H链币费用" required>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-2">
            现金费用
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            <input type="number" class="form-control" name="money"
                   placeholder="请输入现金费用，元" required>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-2">
            详细地址
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            <input type="text" class="form-control" name="address"
                   placeholder="请输入详细地址" required>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">
            排序
        </label>
        <div class="col-xs-9">
            <input type="number" class="form-control" name="order"
                   placeholder="数字越大 排序越靠前">
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-2">
            是否显示
        </label>
        <div class="col-xs-9">
            <div class="btn-group" data-toggle="buttons">
                <label class="btn btn-default active">
                    <input type="radio" name="visible" id="visible_1" value="1" checked>
                    显示
                </label>
                <label class="btn btn-default">
                    <input type="radio" name="visible" id="visible_0" value="0">
                    隐藏
                </label>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">
            首页推荐
        </label>
        <div class="col-xs-9">
            <div class="btn-group" data-toggle="buttons">
                <label class="btn btn-default">
                    <input type="radio" name="recommend" id="recommend_1" value="1">
                    推荐
                </label>
                <label class="btn btn-default active">
                    <input type="radio" name="recommend" id="recommend_0" value="0" checked>
                    不推荐
                </label>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">
            活动详情
        </label>
        <div class="col-xs-9">
            {include file="public/ueditor" editor-name="article_detail" /}
        </div>
    </div>

    <div class="form-group">
        <div class="col-xs-offset-2 col-xs-3">
            <button type="submit" class="btn btn-success btn-block">
                添加
            </button>
        </div>
    </div>
</form>

<script src="__PUBLIC__/vendors/jquery.validation/jquery.validate.min.js"></script>
<script src="__PUBLIC__/vendors/jquery.validation/additional-methods.js"></script>
<script src="__PUBLIC__/vendors/jquery.validation/messages_zh.min.js"></script>
<script src="__PUBLIC__/vendors/select2/js/select2.min.js"></script>
<script type="application/javascript">
    $(function () {
        $("#form-add-article").validate({
            messages:
                {
                    type: "请选择活动类型",
                    title: "请输入活动主题",
                    coin: "请输入H链币费用",
                    money: "请输入现金费用",
                    address: "请输入详细地址",
                },
            debug: true,
            submitHandler: function () {
                ajaxSubmit('form-add-article', true);
            }
        });

        //获取分类
        $("#category-selector").select2({
            placeholder: "选择活动类型",
            allowClear: true,
            width:'100%'
        });
    })
</script>